package com.example.ffepeg.ffeAdder;

import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class TestAddHuo {
    public static void main(String[] args) {
        List<Word> wordEnd = new ArrayList<>();
        // 添加一些单词到列表中
        wordEnd.add(new Word("hello","1"));
        wordEnd.add(new Word("world","2"));
        wordEnd.add(new Word("hello","3"));
        wordEnd.add(new Word("java","4"));
        wordEnd.add(new Word("stream","5"));
        wordEnd.add(new Word("java","6"));

        Word word = new Word("托尔斯泰","9");
        Thread thread = new Thread(word);
        thread.start();
        word.setText("阿斯蒂芬");

        Map<String, List<Word>> wordMap = wordEnd.stream()
                .collect(Collectors.groupingBy(
                        Word::getId,
                        LinkedHashMap::new,
                        Collectors.toList()
                ));

        System.err.println(word);
        System.out.println(wordMap);
    }
}
